<template>
	<view>		
		<view>
			<view style="margin-top:60rpx;">
				<view v-for="(item,index) in indexArr" :key="index">
					<view v-if="item.indexName=='校园巡查违纪登记'" class="indexTeacher" @click="classIndexSkip(item)">
						<view style="margin-left:60upx">
							{{item.indexName}}
						</view>
						<view style="margin-right:20upx">
							>
						</view>
					</view>
					
					<!-- 宿舍请假、违纪登记 -->
					<view v-else-if="item.indexName=='宿舍违纪登记'" class="indexDormitory" @click="classIndexSkip(item)">				
						<view style="margin-left:60upx">
							{{item.indexName}}
						</view>
						<view style="margin-right:20upx">
							>
						</view>
					</view>			
					<!-- 班级违纪 -->
					<view v-else-if="item.indexName=='班级违纪登记'" class="indexClass" @click="classIndexSkip(item)">
						<view style="margin-left:60upx">
							{{item.indexName}}
						</view>
						<view style="margin-right:20upx">
							>
						</view>
					</view>	
					
				</view>
				<view class="attdenanceSty" @click="leaveHistory()">
					<view style="text-align: center;width:605upx;">违纪历史记录</view>
				</view>
			</view>
			<view class="logoSty"  ></view>
		</view>	
		<!-- <my-bottom :bottomArr="attendanceArr" :bottomName="bottomName"></my-bottom> -->
	</view>
</template>

<script>
	import topCom from '../component/topCom.vue'
	import bottomCom from '../component/bottom.vue'
	export default {
		data() {
			return {
				bottomName:'home',
				userName:'',
				topName:'首页',
				showFresh:'true',
				indexArr:[{
					icon:'',
					indexName:'校园巡查违纪登记'
				},{
					icon:'',
					indexName:'宿舍违纪登记'
				},{
					icon:'',
					indexName:'班级违纪登记'
				},],
				attendanceArr:[ {
				    name:'home',
				    icon:'iconfont icon-yonghutongji',
				    text:"违纪",
				    path: '/pages/instructor/instructorIndex'
				},
				{
				    name:'atttendance',
				    icon:'iconfont icon-bi',
				    text:"统计",
				    path: '/pages/instructor/instructorIndex'
				},
				{
				    name:'maintenance',
				    icon:'iconfont icon-shezhi',
				    text:"设置",
				    path: '/pages/instructor/instructorIndex'
				}],
			}
		},
		components:{
			topCom,
			bottomCom
		},
		onShow() {
			// var that = this
		 // uni.getStorage({
		 // 	key:"userInfo",
			// success:(res)=>{
			// 	that.userName = res.data
			// }
		 // })	
		 this.userName= uni.getStorageSync("userRole");
		 // console.log(userInfo)
		 
		},
		mounted(){
		 //  uni.request({
		 //  	url:'http://192.168.200.213:9005',
			// method:'post',
			// dataType:'JSON',
			// success() {
				
			// }
		 //  })
		},
		
		methods: {
			leaveHistory(){
				uni.navigateTo({
					url: '/pages/instructor/historyList',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			classIndexSkip(item){
				if(item.indexName=='校园巡查违纪登记'){
					uni.navigateTo({
						url: '/pages/instructor/schoolDv',
						success: res => {},
						fail: () => {},
						complete: () => {}
					});
				}else if(item.indexName=='宿舍违纪登记'){
					uni.navigateTo({
						url: '/pages/instructor/dormitoryDv',
						success: res => {},
						fail: () => {},
						complete: () => {}
				});
				
				}else{
					// pages/instructor/classDv
					uni.navigateTo({
							url: '/pages/instructor/classDv',
							success: res => {},
							fail: () => {},
							complete: () => {}
					});
				}
			}
		}
	}
</script>

<style>
	.indexContent{
		height: 65vh;
		/* position: relative; */
	}
	.logoSty{
		position: absolute;
		z-index: 999;
		bottom: 50rpx;
	}
	.attdenanceSty{
		margin: auto;
		margin-top:40upx;
		width:605upx;
		height:72upx;
		display: flex;
		justify-content: space-between;
		background-color: #FF0088;
		color:white;
		padding-top:30upx;
		font-size: 42rpx;
		border-radius: 20rpx;
		line-height: 40rpx;
	}
	.indexTeacher{
		margin: auto;
		margin-top:40upx;
		width:605upx;
		height:72upx;
		display: flex;
		justify-content: space-between;
		background-image: url(https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/T-5.png);
		background-size: 100%;
		color:white;
		padding-top:30upx;
		font-size: 42rpx;
		line-height: 40rpx;
		/* opacity: 0.8; */
	}
	.indexHealth{
		margin: auto;
		margin-top:40upx;
		width:605upx;
		height:72upx;
		display: flex;
		justify-content: space-between;
		background-image: url(https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/T-4.png);
		background-size: 100%;
		color:white;
		padding-top:30upx;
		font-size: 42rpx;
		line-height: 40rpx;
	}
	.indexDormitory{
		margin: auto;
		margin-top:40upx;
		width:605upx;
		height:72upx;
		display: flex;
		justify-content: space-between;
		background-image: url(https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/T-6.png);
		background-size: 100%;
		color:white;
		padding-top:30upx;
		font-size: 42rpx;
		line-height: 40rpx;
	}
	.indexClass{
		margin: auto;
		margin-top:40upx;
		width:605upx;
		height:72upx;
		display: flex;
		justify-content: space-between;
		background-image: url(https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/T-4.png);
		background-size: 100%;
		color:white;
		padding-top:30upx;
		font-size: 42rpx;
		line-height: 40rpx;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200upx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
